#!/bin/bash -ev
###
 # @Author: WangYu
 # @Date: 2023-03-16 09:21:59
 # @LastEditors: WangYu
 # @LastEditTime: 2023-08-10 10:03:43
 # @FilePath: /docker-telemac/docker/test.sh
 # @Description: 
 # @copyright: Copyright (c) 2023 by WangYu, All Rights Reserved. 
### 
source ${TELEMAC_ROOT}/setenv.sh
echo $PATH
echo $TELEMAC_ROOT
cd ${HOMETEL}

echo "Running examples/telemac2d/gouttedo"

cd examples/telemac2d/gouttedo
WORK_DONE=$(telemac2d.py t2d_gouttedo.cas --ncsize=4 | grep 'My work is done' | wc -l)

if [[ $WORK_DONE == 1 ]]; then
    echo "Test succeeded"
    exit 0
fi

echo "Test failed"
exit 1